package com.xiaoma.verbal.service;

import static com.xiaoma.verbal.utils.Constants.FTC;
import static com.xiaoma.verbal.utils.Constants.QCTC;
import static com.xiaoma.verbal.utils.Constants.QTTC;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xiaoma.verbal.utils.MemoryDB;

@Service
public class CacheService {
	@Autowired
	private ForecastService forecastService;
	@Autowired
	private QuestionService questionService;
	@Autowired
	private QuClassicService quClassicService;
	@Autowired
	private QuTpoService quTpoService;

	public void reloadTimeCoordinateCache() {
		Long ftc = forecastService.getTimeCoordinate();
		Long qctc = quClassicService.getTimeCoordinate();
		Long qttc = quTpoService.getTimeCoordinate();
		MemoryDB.put(FTC, ftc);
		MemoryDB.put(QCTC, qctc);
		MemoryDB.put(QTTC, qttc);
	}
}
